package dbms;

import java.sql.SQLException;
import java.sql.Statement;

public class DBTables {

	
	public static String CONFIG = "config";
		
	public static String CONFIG_TAB = 					"CREATE TABLE " + DBTables.CONFIG + " (" +
														"`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ," +
														"`program` VARCHAR( 15 ) NOT NULL," +
														"`parameter` INT( 15 ) NOT NULL," +
														"`value` VARCHAR( 100 ))";
	
	public static boolean createDB()
	{
		try {
		
			DBConnection.getIstance().setAutoCommit(false);
			Statement query = DBConnection.getIstance().createStatement();
			
			query.execute(DBTables.CONFIG_TAB);
			
			DBConnection.getIstance().commit();
			DBConnection.getIstance().setAutoCommit(true);	
		
			return true;
			
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			
			return false;
		}
	}

	
}
